//
//  MSRequestOperation.h
//  testMasory
//
//  Created by xiangbo on 2018/9/7.
//  Copyright © 2018年 xiangbo. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MSRequestOperation;

typedef void(^MSCompletionBlock)(NSURLSessionDataTask *task,id response,NSError *error);
typedef void(^MSSuccessBlock)(NSURLSessionDataTask *task,id response);
typedef void(^MSFailureBlock)(NSURLSessionDataTask *task,NSError *error);

@interface MSRequestOperation : NSObject


/**
 GET

 @param url 请求地址
 @param params params参数
 @param classType 返回结果类型
 @param completion block返回
 */
+ (void)GET:(NSString *)url params:(NSDictionary *)params classType:(Class)classType completion:(MSCompletionBlock)completion;


/**
 GET

 @param url 请求地址
 @param params params参数
 @param headers 头信息
 @param classType 返回结果类型
 @param completion block返回
 */
+ (void)GET:(NSString *)url params:(NSDictionary *)params headers:(NSDictionary *)headers classType:(Class)classType completion:(MSCompletionBlock)completion;

/**
 POST
 
 @param url 请求地址
 @param params params参数
 @param classType 返回结果类型
 @param completion block返回
 */
+ (void)POST:(NSString *)url params:(NSDictionary *)params classType:(Class)classType completion:(MSCompletionBlock)completion;


/**
 POST
 
 @param url 请求地址
 @param params params参数
 @param headers 头信息
 @param classType 返回结果类型
 @param completion block返回
 */
+ (void)POST:(NSString *)url params:(NSDictionary *)params headers:(NSDictionary *)headers classType:(Class)classType completion:(MSCompletionBlock)completion;

@end

